package com.zyq.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author: zyq
 * @create: 2021-12-04
 **/
@Mapper
public interface GetLikeAndCollectMapper {
    /**
     * 插入点赞表
     * @param userId
     * @param articleId
     * @return
     */
    public int insertGetLike(@Param("userId") String userId,@Param("articleId") String articleId);

    /**
     * 删除点赞表
     * @param userId
     * @param articleId
     * @return
     */
    public int deleteGetLike(@Param("userId") String userId,@Param("articleId") String articleId);

    /**
     * 插入收藏表
     * @param userId
     * @param articleId
     * @return
     */
    public int collectArticle(@Param("userId") String userId,@Param("articleId") String articleId);

    /**
     * 删除收藏表
     * @param userId
     * @param articleId
     * @return
     */
    public int cancelCollectionArticle(@Param("userId") String userId,@Param("articleId") String articleId);

    /**
     * 插入关注表
     * @param userId
     * @param attentionId
     * @return
     */
    public int insertAttention(@Param("userId") String userId,@Param("attentionId") String attentionId);
    public int flagAttention(@Param("userId") Long userId,@Param("attentionId") Long attentionId);
    /**
     * 删除关注表
     * @param userId
     * @param attentionId
     * @return
     */
    public int deleteAttention(@Param("userId") String userId,@Param("attentionId") String attentionId);

    /**
     * 获取文章被收藏数量
     * @param id
     * @return
     */
    int getCountCollectByArticleId(Long id);

    /**
     * 获取文章点赞数量
     * @param id
     * @return
     */
    int getCountGetLikeByArticleId(Long id);

    int ifCollect(@Param("articlId") Long articlId , @Param("userId")Long userId);

    int ifGetLike(@Param("articlId") Long articlId , @Param("userId")Long userId);


}
